home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
TCL1
/
GRAPH_FO
/
OUTLINEB.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-02-15
|
1KB
|
60 lines
#include <QuickDraw.h>
#include <WindowMgr.h>
#include <ControlMgr.h>
#include <DialogMgr.h>
#include <ToolBoxUtil.h>
static short dfltID;
/*
* OutlineButton.c -- draw outlined button in dialog MM 89/10/22
* OutlineButton: useritem procedure to draw the border around the OK
* (or other default)
* button.
*/
pascal void
OutlineButton(theWindow, itemNo)
DialogPtr theWindow;
int itemNo;
{
short itype;
Handle cHandle;
Rect r;
PenState ps;
Pattern pat;
GetIndPattern(&pat, sysPatListID, 4);
GetPenState(&ps);
GetDItem(theWindow, dfltID, &itype, &cHandle, &r);
if((*((ControlHandle)cHandle))->contrlHilite == 255) {
PenPat(pat);
}
/* Get the location of the default button. */
GetDItem(theWindow, itemNo, &itype, &cHandle, &r);
PenSize(3,3);
FrameRoundRect(&r, 16, 16);
SetPenState(&ps);
}
void
SetOutlineButton(theDialog, defaultID, useritemID)
DialogPtr theDialog;
int defaultID;
int useritemID;
{
int itype;
Handle cHandle;
Rect r;
/* Get the location of the default button. */
GetDItem(theDialog, defaultID, &itype, &cHandle, &r);
dfltID = defaultID;
/* Set up the useritem to wrap around the OK button and have
* userProc() as its drawing function.
*/
InsetRect(&r, -4, -4);
SetDItem(theDialog, useritemID, userItem, (Handle) OutlineButton, &r);
}